package com.panshi.mapper;

import com.panshi.entity.AppAnswer;
import com.panshi.entity.SysAnswerCheck;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 问题回答 mapper
 */
@Mapper
public interface AnswerMapper {

    /**
     * 根据问题id查询数据
     * @param matterId
     * @return
     */
    List<AppAnswer> queryAnswerByMid(@Param("matterId") Integer matterId);

    /**
     *根据回答id修改点赞、踩量
     * @param answerId
     * @param code 标记是点赞还是点踩
     */
    void updatePariseTread(@Param("answerId") Integer answerId,@Param("code") String code);

    /**
     * 将审核通过的回答数据增加到回答表
     * @param sysAnswerCheck
     * @return
     */
    void addAnswer(@Param("answer")SysAnswerCheck sysAnswerCheck);

    /**
     * 删除回答
     * @param answerId
     */
    void deleteAnswer(@Param("answerId") Integer answerId);

    /**
     * 根据回答id查询
     * @param answerId
     * @return
     */
    AppAnswer queryInfo(@Param("answerId") Integer answerId);

}
